package com.xyhua.validator.controller;

import com.xyhua.validator.entity.RRException;

import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * description: ExceptionController <br>
 * date: 2020/3/25 3:56 下午 <br>
 * author: huaxiansheng <br>
 * version: 1.0 <br>
 */
@RestControllerAdvice
public class ExceptionController {

    @ExceptionHandler(Exception.class)
    public String e1(Exception e) {
        e.printStackTrace();
        return e.getMessage();
    }

    @ExceptionHandler(RRException.class)
    public String e2(RRException e) {
        return e.getMsg();
    }


}
